#!/usr/bin/env bash
set -euo pipefail

kill_if(){
  local pidfile="$1"
  if [ -f "$pidfile" ]; then
    kill $(cat "$pidfile") 2>/dev/null || true
    rm -f "$pidfile"
  fi
}

kill_if /tmp/textlabel-frontend.pid
kill_if /tmp/textlabel-backend.pid

echo "[done] 已停止服务"
